/*
 * $Id$
 */
package corejs.parser;

import corejs.JsTokenType;
import corejs.Token;
import corejs.expr.Expression;
import corejs.expr.RefinementExpr;

/**
 *
 * @author myang
 */
public class BracketRefinementParser extends BinaryOperatorParser {

   public BracketRefinementParser() {
      super(Precedence.REFINEMENT);
   }

   @Override
   public Expression expr(final PrattParser parser, 
                          final Expression left, final Token tk) {
      final Expression right = parser.expr();
      parser.nextToken(JsTokenType.RIGHT_BRACKET);
      return new RefinementExpr(left, right);
   }
   
}
